import { randomUUID } from 'crypto';

import { BaseHttpClient } from '@thalorlabs/api';

// Import your normalised type from @thalorlabs/types
// import { YourType } from '@thalorlabs/types';
import { {{NAME_PASCAL}}RawResponse } from './{{NAME_PASCAL}}Types';

export interface {{NAME_PASCAL}}ClientConfig {
  baseURL?: string;
  timeout?: number;
}

export class {{NAME_PASCAL}}Client extends BaseHttpClient {
  public readonly serviceName = '{{NAME}}';

  constructor(config: {{NAME_PASCAL}}ClientConfig = {}) {
    super({
      baseURL: config.baseURL ?? 'https://api.example.com',
      serviceName: '{{NAME}}',
      retries: 3,
      timeout: config.timeout ?? 10000,
    });
  }

  async getData(): Promise<{{NAME_PASCAL}}RawResponse> {
    const { response } = await this.handleRequest<{{NAME_PASCAL}}RawResponse>(
      { method: 'GET', url: '/' },
      { method: 'GET', url: '/', requestId: randomUUID() }
    );
    return response.data;
  }
}
